package com.yykj.user.center.server.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yykj.common.util.serializer.LocalDate2LongSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @author chenl
 * @version 1.0
 * @date 2021/11/6 13:14
 */
//问诊信息
@Data
@Entity
public class ConsultationInfoOrder {

    @Id
    private String id;

    @ApiModelProperty("病情描述")
    @Column(columnDefinition = "text")
    private String description;

    private String weight;

    private String height;

    @ApiModelProperty("民族")
    private String nameFamily;

    @ApiModelProperty("身份证号")
    private String idCard;

    @ApiModelProperty("血型")
    private String bloodTye;

    @ApiModelProperty("婚姻")
    private String marriage;

    @ApiModelProperty("生育")
    private String birth;

    @ApiModelProperty("过敏史")
    @Column(columnDefinition = "text")
    private String allergicHistory;

    @ApiModelProperty("现病史")
    @Column(columnDefinition = "text")
    private String medicalHistory;

    @ApiModelProperty("其他病史")
    @Column(columnDefinition = "text")
    private String otherMedicalHistory;

    @ApiModelProperty("家族病史")
    @Column(columnDefinition = "text")
    private String familyHistory;

    @ApiModelProperty("支付人的帐号ID")
    private String payAccountId;

    private Integer hospitalId;

    private String hospitalName;

    private Integer deptId;

    private String deptName;

    private String doctorId;

    private String doctorName;

    @ApiModelProperty("创建时间")
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    @CreationTimestamp
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    @UpdateTimestamp
    private LocalDateTime updateTime;

    @ApiModelProperty("上午还是下午")
    private String morningOrAfternoon;

    @ApiModelProperty("订单类型：11、图文问诊 12、语音问诊 13、视频问诊 14、检查订单 15、检验订单 16、续方问诊(图文问诊)")
    private Integer orderType;

    @ApiModelProperty("支付金额")
    @Column(precision = 10,scale = 2)
    private BigDecimal payAmount;

    @ApiModelProperty("就诊开始时间")
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    private LocalDateTime startDatetime;

    @ApiModelProperty("就诊结束时间")
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    private LocalDateTime endDatetime;

    @ApiModelProperty("支付时间")
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    private LocalDateTime payTime;

    @ApiModelProperty("退款时间")
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    private LocalDateTime refundTime;

    @ApiModelProperty("患者支付状态-1:取消,0:待支付,1:已支付")
    @Column(length = 1)
    private Integer payStatus=0;

    @ApiModelProperty("患者退款状态-1:未退款,0:申请退款,1:已退款,2:退款失败")
    @Column(length = 1)
    private Integer refundStatus=-1;

    @ApiModelProperty("支付方式,1:微信,2:支付宝")
    @Column(length = 1)
    private Integer payType=0;

    @ApiModelProperty("订单号")
    @Column(length = 32)
    private String orderNo;

    @ApiModelProperty("就诊卡号ID")
    @Column(length = 32)
    private String patientCardId;

    @ApiModelProperty("预约日期")
    private LocalDate date;

    @ApiModelProperty("就诊卡对应的名称")
    @Column(length = 20)
    private String patientName;

    @ApiModelProperty("状态：0生成订单 1待接诊  2问诊中  3已完成 4已退款")
    private Integer state=0;

    @ApiModelProperty("接诊时间")
    private LocalDateTime receiveTime;

    @ApiModelProperty("结束方式：0手动结束 1自动结束")
    private Integer endType=-1;

    private String birthday;

    private String sex;

    private Integer age;

    @ApiModelProperty("服务结束时间")
    private LocalDateTime serviceEndTime;

    private String doctorTencentAccountId;
    private String patientTencentAccountId;

    @ApiModelProperty("授权信息：0未授权 1已授权")
    private int auth = 0;

    @ApiModelProperty("处方ID")
    private String prescriptionId;

}
